import { createWebHashHistory } from "vue-router"
import { createRouter } from "vue-router"

const routes = [
  {path:'/',redirect:'/home'},
  {path:'/home',name:"home",components:{
    default:()=>import("@/views/Home/Home.vue"),
    mytab:()=>import("@/components/MyTab.vue"),
  }},
  {path:'/detail/:proid',name:"detail",component:()=>import("@/views/Home/MyDetail.vue")},
  {path:'/register',redirect:"/register/tel",
    children:[
    {path:"tel",name:"tel",component:()=>import("@/views/Register/Tel.vue")},
    {path:"code",name:"code",component:()=>import("@/views/Register/Code.vue")},
    {path:"pass",name:"pass",component:()=>import("@/views/Register/Pass.vue")},
  ]},
  {path:'/cart',name:"cart",components:{
    default:()=>import("@/views/Cart/Cart.vue"),
    mytab:()=>import("@/components/MyTab.vue"),
  }},
  {path:'/cate',name:"cate",components:{
    default:()=>import("@/views/Cate/Cate.vue"),
    mytab:()=>import("@/components/MyTab.vue"),
  }},
  {path:'/login',name:"login",components:{
    default:()=>import("@/views/Login/Login.vue"),
    mytab:()=>import("@/components/MyTab.vue"),
  }},
]

const router = createRouter({
  history:createWebHashHistory(),
  routes
})

export default router;


